package xyz.renyumeng.xkm.es.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
import xyz.renyumeng.xkm.model.es.EsProduct;

/**
 * @author renyumeng
 * @date Created in 20:51 2023/7/3
 */

@Repository
public interface EsProductRepository extends ElasticsearchRepository<EsProduct, Long> {

    Page<EsProduct> findEsProductByDescriptiveContentAndIsSoledAndIsListed(String descriptiveContent, Integer isSoled, Integer isListed,Pageable pageable);

    Page<EsProduct> findEsProductByOwnerId(Long ownerId, Pageable pageable);

    EsProduct findEsProductByIdAndIsListedAndIsSoled(Long id,Integer isListed,Integer isSoled);
    Page<EsProduct> findEsProductByOwnerIdAndIsSoled(Long ownerId, Integer isSoled, Pageable pageable);

}
